package keeto.com.vn.bms.network.task;

import java.io.IOException;

import keeto.com.vn.bms.config.IBMSCore;
import keeto.com.vn.bms.network.IBMSProtocol;
import keeto.com.vn.bms.utils.BMSListener;

import org.apache.http.client.ClientProtocolException;
import org.json.JSONException;

public class TaskGetTimeNotification extends AbstractTask{

	public TaskGetTimeNotification(BMSListener listener, IBMSCore core) {
		super(listener, core);
	}

	@Override
	public void run() throws ClientProtocolException, JSONException, IOException {
		int reponse = protocol.GetTimeNotification();
		for(BMSListener mListener:listener){
			mListener.finishGetTimeNotification(reponse);
		} 
	}

	@Override
	public void timeoutCallback() {
		for(BMSListener mListener:listener){
			mListener.finishGetTimeNotification(0);
		}
	}

}
